/*
 * prelim.h
 * KJ's simplified stream archiver (kjssar)
 * 
 * (C)Copyright 2013-2015 by Klaus-J. Wolf, kj (at) seismic (dot) de
 * This file is licensed under the General Public License Version 2.
 * http://www.gnu.org/licenses/gpl-2.0.html
 * 
 * This is a proof-of-concept implementation.
 * 
 */

#define DEBUG 1


typedef unsigned char      uint8;
typedef unsigned short     uint16;
typedef unsigned           uint32;
typedef unsigned long long uint64;

typedef unsigned char      uchar;


#if !DEBUG
#define FAIL(rv) return rv;
#else
#define FAIL(rv) abort();
#endif

#define MEMASSERT(v,rv) if(!(v)) FAIL(rv)
#define IOASSERT(v,rv)  if((v)<0) FAIL(rv)
#define IOXASSERT(v,badv,rv)  if((v)==(badv)) FAIL(rv)

/*#########################*/

#define SIZE(x) (sizeof x / sizeof x[0])
